﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPageAdmin.master" AutoEventWireup="true" CodeFile="Add_role.aspx.cs" Inherits="Admin_Add_role" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style8
        {
            width: 41px;
        }
        .style9
        {
            text-align: center;
        }
        .style10
        {
            text-align: center;
            width: 470px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table class="style7">
        <tr>
            <td colspan="3" style="font-weight: 700; color: #0066FF; text-align: center">
                <asp:Label ID="Label1" runat="server" Text="Add Role"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="style10">
                &nbsp;</td>
            <td class="style8">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style10" style="text-align: right">
                <asp:Label ID="Label3" runat="server" Text="Name"></asp:Label>
            </td>
            <td class="style8">
                &nbsp;</td>
            <td>
                <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style9" colspan="3">
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                    DeleteCommand="DELETE FROM [tblRole] WHERE [roleId] = @roleId" 
                    InsertCommand="INSERT INTO [tblRole] ([roleName]) VALUES (@roleName)" 
                    SelectCommand="SELECT * FROM [tblRole]" 
                    UpdateCommand="UPDATE [tblRole] SET [roleName] = @roleName WHERE [roleId] = @roleId">
                    <DeleteParameters>
                        <asp:Parameter Name="roleId" Type="Int32" />
                    </DeleteParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="roleName" Type="String" />
                        <asp:Parameter Name="roleId" Type="Int32" />
                    </UpdateParameters>
                    <InsertParameters>
                        <asp:ControlParameter ControlID="txtName" Name="roleName" PropertyName="Text" 
                            Type="String" />
                    </InsertParameters>
                </asp:SqlDataSource>
                <asp:Button ID="btnAdd" runat="server" onclick="btnAdd_Click" Text="Add" />
            </td>
        </tr>
    </table>
</asp:Content>

